<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>我的资质</title>
    <link type="text/css" rel="stylesheet" href="css/index.css"/>
    <script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
    <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>
    <script type="text/javascript" src="js/vue.min.js"></script>
    <script type="text/javascript" src="js/myInformation.js"></script>
</head>
<body>
<div id="header"></div>

<div id="jkrxxrz"></div>

<br />

<div id="app" class="container" style="width: 60%">
    <form id="updateForm" class="form-horizontal" role="form" enctype="multipart/form-data">
<!--        <input type="hidden" id="userId" th:value="${session.loginUser.userId}"></input>-->

        <div class="form-group">
            <label class="col-sm-2 control-label">真实姓名</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="trueName" :value="user.trueName"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">性别</label>
            <div class="col-sm-10">
                <select class="form-control" id="sex" name="sex">
                    <option value="-1">请选择</option>
                    <option value="男" :selected="user.sex === '男'">男</option>
                    <option value="女" :selected="user.sex === '女'">女</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">出生日期</label>
            <div class="col-sm-10">
                <input class="form-control" type="date" name="birth" :value="user.birth"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="tel" :value="user.tel"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">所在地</label>
            <div class="col-sm-3">
                <select class="form-control" id="province" name="province" onchange="getCityByProId(this.value)"></select>
            </div>
            <div class="col-sm-3">
                <select class="form-control" id="city" name="city" onchange="getDistrictByCityId(this.value)"></select>
            </div>
            <div class="col-sm-3">
                <select class="form-control" id="district" name="district"></select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">详细地址</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="address" :value="user.address"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">身份证类型</label>
            <div class="col-sm-10">
                <select class="form-control" id="idType" name="idType">
                    <option v-for="idCardType in idCardTypes" :key="idCardType.idCardTypeId" :value="idCardType.idCardTypeId" :selected="idCardType.idCardTypeId === user.idType">{{idCardType.typeName}}</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="idCard" :value="user.idCard"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="email" :value="user.email"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">QQ</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="qq" :value="user.qq"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">微信</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="weChat" :value="user.weChat"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">行业</label>
            <div class="col-sm-10">
                <input class="form-control" type="text" name="industry" :value="user.industry"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">客户类型</label>
            <div class="col-sm-10">
                <select class="form-control" id="userType" name="userType">
                    <option value="-1">请选择</option>
                    <option value="企业" :selected="user.userType === '企业'">企业</option>
                    <option value="个人" :selected="user.userType === '个人'">个人</option>
                </select>
            </div>
        </div>

        <div class="form-group" style="text-align: center;">
            <label>头像</label><br/><br/>
            <label for="avatar">
                <img v-if="user.avatar == '' || user.avatar == null" src="images/add.jpg" width="120px" height="76px"/>
                <img v-else :src="user.avatar" width="120px" height="76px"/><br/>
                上传图片
            </label>
            <input type="file" id="avatar" name="file" onclick="uploadPreview(this)" style="position:absolute;clip:rect(0 0 0 0);"/>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-5 col-sm-2" style="text-align: center;">
                <button onclick="updateUser()" type="button" class="btn btn-default">提交</button>
            </div>
        </div>
    </form>
</div>

<div style="margin-top: 30px"></div>

<div id="footer"></div>
</body>
</html>